import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/user'
  },
  {
    path: '/home',
    component: HomeView,
    children: [{
      path: 'index',
      component: () => import('../views/index/Index.vue'),
    },{
      path: 'shopping',
      component: () => import('../views/shopping/Shopping.vue'),
    },{
      path: 'cart',
      component: () => import('../views/cart/Cart.vue'),
    },{
      path: 'my',
      component: () => import('../views/my/My.vue'),
    }
    ]
  },
  {
    path: '/about',
    name: 'about',
    component: () => import( '../views/AboutView.vue')
  },{
    path: '/user',
    component: () => import('../views/user/User.vue'),
  }
  ,{
      path: '/card',
      component: () => import('../views/mys/card.vue'),
    },{
    path: '/account',
    component: () => import('../views/mys/account.vue'),
  }
  // ,{
  //   path: '/add-dz',
  //   component: () => import('../views/mys/address.vue'),
  // }
  ,{
    path: '/remainder',
    component: () => import('../views/mys/remainder.vue'),
  }
  ,{
    path: '/integral',
    component: () => import('../views/mys/integral.vue'),
  }
  ,{
    path: '/coupon',
    component: () => import('../views/mys/coupon.vue'),
  }
  ,{
    path: '/change',
    component: () => import('../views/mys/change.vue'),
  }
  ,{
    path: '/obligation',
    component: () => import('../views/mys/obligation.vue'),
  }
  ,{
    path: '/shipped',
    component: () => import('../views/mys/shipped.vue'),
  }
  ,{
    path: '/received',
    component: () => import('../views/mys/received.vue'),
  }
  ,{
    path: '/evaluated',
    component: () => import('../views/mys/evaluated.vue'),
  }
  ,{
    path: '/service',
    component: () => import('../views/mys/service.vue'),
  }
  ,{
    path: '/assignment',
    component: () => import('../views/mys/assignment.vue'),
  }
  ,{
    path: '/cashback',
    component: () => import('../views/mys/cashback.vue'),
  }
  
  ,{
    path: '/gift',
    component: () => import('../views/mys/gift.vue'),
  }
  ,{
    path: '/addressList',
    component: () => import('../views/mys/addressList.vue'),
  }
  ,{
    path: '/addressEdit',
    component: () => import('../views/mys/addressEdit.vue'),
  }
  ,{
    path: '/exercise',
    component: () => import('../views/mys/exercise.vue'),
  }
  ,{
    path: '/data',
    component: () => import('../views/mys/data.vue'),
  }
  ,{
    path: '/cart',
    component: () => import('../views/cart/Cart.vue'),
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
